{extend name="public/base"/}
{block name="body"}

<div class="main-box clearfix">
	<header class="main-box-header clearfix">
		<div class="pull-left">
			<h2>配置管理</h2>
		</div>
	</header>
	<div class="main-box-body clearfix">
		<form method="post" class="form form-horizontal">
			<div class="form-group">
				<label class="col-lg-2 control-label">配置标识</label>
				<div class="col-lg-10">
					<input type="text" class="form-control" style="width: 400px" name="name" value="{$info.name|default=''}">            
					<span class="help-block">（用于config函数调用，只能使用英文且不能重复）</span>
				</div>
			</div>
			<div class="form-group">
				<label class="col-lg-2 control-label">配置标题</label>
				<div class="col-lg-10">
					<input type="text" class="form-control" style="width:400px;" name="title" value="{$info.title|default=''}">            
					<span class="help-block">（用于后台显示的配置标题）</span>
				</div>
			</div>
			<div class="form-group">
				<label class="col-lg-2 control-label">排序</label>
				<div class="col-lg-10">
					<input type="text" class="form-control" style="width: 400px" name="sort" value="{$info.sort|default=0}">            
					<span class="help-block">（用于分组显示的顺序）</span>
				</div>
			</div>
			<div class="form-group">
				<label class="col-lg-2 control-label">配置类型</label>
				<div class="col-lg-10">
					<select name="type" class="form-control" style="width:auto;">
						{volist name=":config('config_type_list')" id="type"}
							<option value="{$key}" {eq name="key" value="$info['type']"}selected{/eq}>{$type}</option>
						{/volist}
					</select>
					<span class="help-block">（系统会根据不同类型解析配置值）</span>
				</div>
			</div>
			<div class="form-group">
				<label class="col-lg-2 control-label">配置分组</label>
				<div class="col-lg-10">
					<select name="group" class="form-control" style="width: auto">
						<option value="0">不分组</option>
						{volist name=":config('config_group_list')" id="group"}
							<option value="{$key}" {eq name="key" value="$info['group']"}selected{/eq}>{$group}</option>
						{/volist}
					</select>
					<span class="help-block">（配置分组 用于批量设置 不分组则不会显示在系统设置中）</span>
				</div>
			</div>
			<div class="form-group">
				<label class="col-lg-2 control-label">配置值</label>
				<div class="col-lg-10">
					<textarea name="value" class="form-control" style="width: 80%;height: 120px">{$info.value|default=''}</textarea>
					<span class="help-block">（配置值）</span>
				</div>
			</div>
			<div class="form-group">
				<label class="col-lg-2 control-label">配置项</label>
				<div class="col-lg-10">
					<textarea name="extra" class="form-control" style="width: 80%;height: 120px">{$info.extra|default=''}</textarea>
					<span class="help-block">（如果是枚举型 需要配置该项）</span>
				</div>
			</div>
			<div class="form-group">
				<label class="col-lg-2 control-label">说明</label>
				<div class="col-lg-10">
					<textarea name="remark" class="form-control" style="width: 80%;height: 120px">{$info.remark|default=''}</textarea>
					<span class="help-block">（配置详细说明）</span>
				</div>
			</div>
			<div class="form-group">
				<div class="col-lg-offset-2 col-lg-10">
					<input type="hidden" name="id" value="{$info.id|default=''}">            
					<button class="btn btn-success submit-btn ajax-post" type="submit" target-form="form-horizontal">确 定</button>
					<button class="btn btn-danger btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
				</div>
			</div>
		</form>
	</div>
</div>

{/block}